package br.edu.ufc.deti.doodlematricula.util;

import java.util.ArrayList;

public class Line {
	private ArrayList<Integer> days; 
	private ArrayList<String> hours;
	
	public Line() {
		days = new ArrayList<Integer>(5);
		hours = new ArrayList<String>(5);
		for (int i = 0; i<5; i++) {
			days.add(i, 0);
			hours.add("");
		}
	}
	
	public void vote(int i, String hour){
		if(i<5 && i>=0){
			days.add(i-1, 1);
			hours.add(i-1, hour);
		}
	}
	
	public String toString(){
		String ret = "";
		for (int i = 0; i<5; i++) {
			if(days.get(i) == 0){
				ret += 
					"	<td class='n tsep' title='Fulanooooo, Thursday, October 13, 2011 12:00 PM: No'> "+
					"		<div class='partTableCell pn'> "+
					"		</div> "+
					"	</td> ";
			}else{
				ret += 
					"	<td class='y tsep' title='Cicrano, Thursday, October 13, 2011 10:00 AM: Yes'> "+ hours.get(i)+
					"       <div class='partTableCell pok'> "+
					"		</div> "+
					"	</td>";
			}
		}
		return ret;
	}
}
